<?php

namespace Database\Factories;

use App\Models\ESCluster;
use Illuminate\Database\Eloquent\Factories\Factory;

/**
 * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\ClusterReport>
 */
class ClusterReportFactory extends Factory
{
    /**
     * Define the model's default state.
     *
     * @return array<string, mixed>
     */
    public function definition(): array
    {
        return [
            'name' =>  $this->faker->numberBetween(0, 6) . '#簇',
            'voltage' => $this->faker->randomElement([760.2, 778.5, 782.3, 745.2, 764.8]),
            'current' => $this->faker->randomElement([23, 18, 7, 20, 25]),
            'SOC' => $this->faker->randomElement([90, 95, 97, 99, 100]),
            'SOH' => $this->faker->randomElement([90, 95, 97, 99, 100]),
            'temperature' => $this->faker->randomElement([15, 35, 19, 21, 27]),
            'e_s_cluster_id' =>  $this->faker->randomElement(ESCluster::all()->pluck('id')),
        ];
    }
}
